<!--#
layout("/layouts/platform.html"){
#-->
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/platform/store/config/level" id="goBack" data-pjax><i class="ti-angle-left"></i>${msg['globals.button.back']}</a>
    </div>
</header>

<div class="content-wrap">
    <div class="wrapper" style="min-height:500px;">
        <section class="panel panel-form">
            <form id="addForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                  action="${base}/platform/store/config/level/addDo" method="post">
                <div class="row mb10 mt10">
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label for="name" class="col-sm-2 control-label">${msg['store.level.column.name']}</label>
                            <div class="col-sm-8">
                            <input type="text" id="name" class="form-control" name="name" data-parsley-required="true" placeholder="${msg['store.level.column.name']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="goodsLimit" class="col-sm-2 control-label">${msg['store.level.column.goodsLimit']}</label>
                            <div class="col-sm-2">
                            <input type="text" id="goodsLimit" class="form-control" name="goodsLimit" data-parsley-required="true" data-parsley-type="integer" placeholder="${msg['store.level.tip.goodsLimit']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="level" class="col-sm-2 control-label">${msg['store.level.column.level']}</label>
                            <div class="col-sm-2">
                            <input type="text" id="level" class="form-control" name="level" data-parsley-required="true" data-parsley-type="integer" placeholder="${msg['store.level.tip.level']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="price" class="col-sm-2 control-label">${msg['store.level.column.price']}</label>
                            <div class="col-sm-2">
                            <input type="text" id="price" class="form-control" name="price" data-parsley-required="true" data-parsley-type="integer" placeholder="${msg['store.level.tip.price']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="rate" class="col-sm-2 control-label">${msg['store.level.column.rate']}</label>
                            <div class="col-sm-2">
                            <input type="text" id="rate" class="form-control" name="rate" data-parsley-required="true" data-parsley-rate="true" placeholder="${msg['store.level.tip.rate']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="note" class="col-sm-2 control-label">${msg['store.level.column.note']}</label>
                            <div class="col-sm-4">
                                <textarea id="note" class="form-control" name="note" placeholder="${msg['store.level.tip.note']}"></textarea>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3"></div>
                <div class="col-lg-6">
                    <div class="form-group text-center">
                        <label></label>

                        <div>
                            <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="${msg['globals.button.submit.tip']}">${msg['globals.button.submit']}</button>
                        </div>
                    </div>
                </div>
            </form>
        </section>
    </div>
</div>
<script language="JavaScript">
    $(document).ready(function () {
        $('#addForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    form.resetForm();
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
    });
</script>
<!--#}#-->


